package com.sz.biz.logistics.base.dto;

import com.sz.common.base.entity.Entity;

public class  Postcode implements Entity {
    /**
     * 邮编开始
     */
    private String startPostcode;

    /**
     * 邮编结束
     */
    private String endPostcode;
    /**
     * 国家二字码
     */
    private String country;
    /**
     * 国家名字
     */
    private String countryName;

    public Postcode() {

    }

    public Postcode(String startPostcode, String endPostcode, String country, String countryName) {
        this.startPostcode = startPostcode;
        this.endPostcode = endPostcode;
        this.country = country;
        this.countryName = countryName;
    }

    public Postcode(String startPostcode, String endPostcode, String country) {

        this.startPostcode = startPostcode;
        this.endPostcode = endPostcode;
        this.country = country;
    }

    public String getStartPostcode() {
        return startPostcode;
    }

    public void setStartPostcode(String startPostcode) {
        this.startPostcode = startPostcode;
    }

    public String getEndPostcode() {
        return endPostcode;
    }

    public void setEndPostcode(String endPostcode) {
        this.endPostcode = endPostcode;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getCountryName() {
        return countryName;
    }

    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Postcode postcode = (Postcode) o;

        if (!startPostcode.equals(postcode.startPostcode)) {
            return false;
        }
        if (!endPostcode.equals(postcode.endPostcode)) {
            return false;
        }
        return country.equals(postcode.country);

    }

    @Override
    public int hashCode() {
        int result = startPostcode.hashCode();
        result = 31 * result + endPostcode.hashCode();
        result = 31 * result + country.hashCode();
        return result;
    }
}